package org.jeecg.modules.gwcjava.jiekou.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.ParameterModule.entity.AddSystemPriceInfo;
import org.jeecg.modules.alipay.bo.PaymentBO;
import org.jeecg.modules.gwcjava.jiekou.entity.*;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface BusinessLogicMapper extends BaseMapper<MlccLookingInfo> {
    //产品求购
    int add_looking(@Param("userId")String userId,@Param("looking_title")String looking_title, @Param("looking_detail")String looking_detail, @Param("imgs")String imgs, @Param("create_time")Date create_time);
    //查询导航栏的模块
    List<ModelInfo> query_module();
    //根据公司id查询所有门店
    List<StoreInfo> query_storeinfo(@Param("companyId")String companyId,@Param("type")int type);
    //根据门店编号查询门店
    StoreInfo query_storeDetailBycode(@Param("storeCode")String storeCode);
    //根据门店编号查询门店的常用地址列表
    List<StoreInfo> query_storeAddressBycode(@Param("storeCode")String storeCode);
    //根据地址id查询地址详情
    StoreInfo query_nomladdressByid(@Param("address_id")String address_id);
    //根据传入的类型查询不同的数据
    List<DataTypeInfo> query_dataBytype(@Param("type")String type);
    //查询所有快递
    List<CourierInfo> query_AllCourier();
    //根据导航栏id和类别id查询模块名称
    List<ModuleSmalltemplateInfo> query_SmalltemplateInfo(@Param("moduleId")String moduleId,@Param("category_id")String category_id);
    //根据模块id查询类别
    List<CategoryInfo> query_categoryInfo(@Param("templateId")String templateId,@Param("category_id")String category_id);
    //查询所有绣字字体
    List<EmbroideredFontInfo> query_AllembroiderFont(@Param("category_ids")String category_ids,@Param("type")int type);
    //查询所有绣字颜色
    List<EmbroideredColorInfo> query_AllembroiderColor(@Param("category_ids")String category_ids);
    //查询所有撞色
    List<ContrastcolorInfo> query_AllContrastcolorInfo(@Param("category_id")String category_id,@Param("category_ids")String category_ids);
    //修改撞色的色值
    int update_Contrastcolor(@Param("id")String id,@Param("color_id")String color_id);
    //添加修改撞色的记录
    int add_ContrastcolorRedcord(@Param("zhuangse_id")String zhuangse_id,@Param("color_id")String color_id,@Param("user_id")String user_id,@Param("category_ids")String category_ids,@Param("product_id")String product_id);
    //根据撞色id产品id用户id修改撞色记录
    int update_ContrastcolorRedcord(@Param("color_id")String color_id,@Param("zhuangse_id")String zhuangse_id,@Param("user_id")String user_id,@Param("category_ids")String category_ids,@Param("product_id")String product_id);
    //根据撞色id和颜色id产品id用户id查询
    ZhuangseRedcordInfo query_zhuangseRedcordById(@Param("zhuangse_id")String zhuangse_id,@Param("user_id")String user_id,@Param("category_ids")String category_ids,@Param("product_id")String product_id);

    //根据查询模块id和类别id查询身体数据
    List<BodySizeInfo> query_bodySizeinfo(@Param("template_id")String template_id,@Param("category_id")String category_id,@Param("is_jin")String is_jin);
    //根据查询模块id和类别id查询身体部位数据
    List<SizeInfo> query_sizeInfo(@Param("template_id")String template_id,@Param("category_id")String category_id);
    List<SizeInfo1> query_sizeInfo1(@Param("sizeId")String sizeId);
    //增加模板
    int add_templateInfo(TemplateRecordInfo templateInfo);
    //编辑更新模板
    int update_single_templateInfo(TemplateRecordInfo templateInfo);
    //根据类别id查询类别详情
    CategoryInfo query_categoryDetailInfo(@Param("category_id")String category_id);
    //根据token查询模板列表
//    List<TemplateRecordInfo> query_templateInfoByuserid(@Param("user_id")String user_id);
    IPage<TemplateRecordInfo> query_templateInfoByuserid(@Param("page")Page<TemplateRecordInfo> page,@Param("user_id")String user_id);
    //生成订单
    int add_signOrderInfo(SingleOrderInfo templateInfo);
    //根据订单号查询订单
    SingleOrderInfo query_signorder(@Param("order_sn")String order_sn);
    //根据模板编号查询模板
    TemplateRecordInfo query_templateRecordInfo(@Param("order_sn")String order_sn);
    //添加订单与尺寸关系表--改为产品尺寸关系表
    int add_Order_sizeInfo(@Param("order_id")String order_id,@Param("bodysize_id")String bodysize_id,@Param("sizevalue")String sizevalue,@Param("is_order")String is_order,@Param("create_time")Date create_time);
    //根据类别id查询位置
    List<CategoryLocaltion> query_localtionInfo(@Param("category_id")String category_id);
    //根据用户id查询订单
    IPage<TemplateRecordInfo> query_orderinfoByuserId(@Param("page")Page<TemplateRecordInfo> page, @Param("user_id")String user_id);
    //根据用户id查询模板
    IPage<TemplateRecordInfo> query_signmoduleinfo(@Param("page")Page<TemplateRecordInfo> page,@Param("user_id")String user_id,@Param("type")int type);
    //根据用户id查询订单2
    IPage<SingleOrderInfo> query_orderinfoByuserId2(@Param("page")Page<SingleOrderInfo> page,@Param("user_id")String user_id,@Param("queryTime")String queryTime,@Param("queryName")String queryName);
    //根据面料id查询面料详情
    FabricInfo query_fabricDetailInfo(@Param("fabric_id")String fabric_id);
    //根据纽扣id查询纽扣详情
    ButtonsInfo query_buttonsInfo(@Param("buttons_id")String buttons_id);
    //根据绣字类型id查询绣字类型详情
    EmbroideredTypePriceInfo query_emPriceinfo(@Param("emid")String emid);
    //根据用户id和订单号修改状态
    int update_status(@Param("order_sn")String order_sn,@Param("type")int type);
    //根据订单号更新订单
    int update_single_order(SingleOrderInfo orderInfo);
    //添加产品
    int insert_products(ProductInfo productInfo);
    //创建产品--添加到部门
    int insert_products_todepart(@Param("productId")String productId,@Param("departId")String departId,@Param("creaTime")Date creaTime);
    //编辑产品
    int update_products(ProductInfo productInfo);
    //根据订单号查询产品列表
    List<ProductInfo> query_productInfoByorderSn(@Param("user_id")String user_id,@Param("order_sn")String order_sn);
    //创建团订订单
    int insert_team_order(TeamOrderInfo teamOrderInfo);
    //创建团订模板
    int insert_team_template(TeamTemplateInfo templateInfo);
    //编辑团订订单
    int update_team_order(TeamOrderInfo teamOrderInfo);
    //编辑团订模板
    int update_team_template(TeamTemplateInfo templateInfo);
    //根据用户id和type查询团队模板和订单表
    IPage<TeamTemplateInfo> query_teamTemplateInfo(@Param("page")Page<TeamTemplateInfo> page,@Param("user_id")String user_id,@Param("orgcode")String orgcode,@Param("type")int type);
    //根据模板编号查询模板详情
    TeamTemplateInfo query_teamTemplateDetailInfo(@Param("order_sn")String order_sn);
    //根据模板编号查询产品列表
    List<ProductInfo> query_productInfoBytemplateSn(@Param("user_id")String user_id,@Param("template_sn")String template_sn);
    //根据产品id查询产品详情
    ProductInfo query_productDetail(@Param("product_id")String product_id);
    //根据用户id查询业务流水表
    List<BusinessWaterInfo> query_businesswaterInfo(@Param("user_id")String user_id,@Param("StartTime")String StartTime,@Param("endTime")String endTime);
    //根据时间统计业务流水表的笔数
    List<BusinessWaterInfo> count_businesswaterInfo(@Param("creatime")String creatime,@Param("user_id")String user_id);
    //根据订单id查询订单金额
    BusinessWaterInfo queryOrderMoney(@Param("id")String id,@Param("type")int type);
    //根据条件查询业务流水表
    List<BusinessWaterInfo> query_businesswater_today(@Param("user_id")String user_id,@Param("addtime")String addtime);
    //根据产品id和尺寸id查询产品尺寸关联表
    List<BodySizeInfo> query_bodySizeinfo_productid(@Param("productId")String productId,@Param("bodysizeId")String bodysizeId,@Param("bodysizeVaule")String bodysizeVaule);
    //根据用户id查询用户业务流水表
    IPage<BusinessWaterInfo> query_yewu_waterInfo(@Param("page")Page<BusinessWaterInfo> page,@Param("user_id")String user_id,@Param("type")int type);

    //根据客户id，产品id，订单编号查询小产品
    SmallProductInfo query_smallProductInfo(@Param("teamOrderSn")String teamOrderSn,@Param("productId")String productId,@Param("customerId")String customerId);
    //创建团订下的小产品
    int insert_teamOrder_products(SmallProductInfo dataInfo);
    //修改团订下的小产品
    int update_teamOrder_products(SmallProductInfo dataInfo);
    //添加小产品尺寸关联表
    int insert_smallproduct_bodysizes(@Param("team_order_sn")String team_order_sn,@Param("customer_product_id")String customer_product_id,@Param("bodysize_id")String bodysize_id,@Param("bodysize_value")String bodysize_value);
    //修改小产品尺寸关联表
    int update_smallproduct_bodysizes(@Param("team_order_sn")String team_order_sn,@Param("customer_product_id")String customer_product_id,@Param("bodysize_id")String bodysize_id,@Param("bodysize_value")String bodysize_value,@Param("status")int status);

    //根据订单编号查询和类型查询订单详情
    PaymentBO query_paymentBODetail(@Param("order_sn")String order_sn, @Param("type")String type);

    //根据团订下的客户id和客户编码查询客户信息
    CustomerInfo queryCostomerDtailById(@Param("customerId")String customerId,@Param("code")String code);
    //根据部门id查询部门下的产品
    List<ProductInfo> query_allproductBydepartId(@Param("departId")String departId,@Param("sex")String sex);
    //删除部门下的产品
    int delete_depart_product(@Param("id")String id);
    //根据大产品id删除小产品量体
    int delete_liangti_byproductId(@Param("product_id")String product_id);
    //根据客户id查询量体信息
    IPage<CustomerInfo> query_customer_liangti(@Param("page")Page<CustomerInfo> page,@Param("partmentId")String partmentId,@Param("queryName")String queryName,@Param("is_liangti")int is_liangti);
    //根据团订下的客户id查询客户信息（这里是公司身份）
    CustomerInfo queryCostomerInfoById(@Param("customerId")String customerId);

    //查询我的消息
    List<MessageDataInfo2> query_mymessage(@Param("queryName")String queryName,@Param("is_read")String is_read,@Param("user_id")String user_id);
    //查询消息详情
    MessageDataInfo2 query_messageDetail(@Param("msg_id")String msg_id);

    //添加消息已读
    int add_readed_message(@Param("message_id")String message_id,@Param("sys_user_id")String sys_user_id,@Param("userType")String userType);
    //查询已读消息详情
    MessageDataInfo2 query_read_messageDetail(@Param("message_id")String message_id,@Param("sys_user_id")String sys_user_id);

    //查询价格体系
    PriceSystemPinleiInfo query_pricesysytemDetail(@Param("category_id")String category_id,@Param("bussiness_type")String bussiness_type,@Param("is_gognyi")String is_gognyi);
    List<PriceSystemQujianInfo> query_pricequjian(@Param("system_price_id")String system_price_id);
    //查询订单基本信息
    TeamOrderInfo queryteamOrderDetail(@Param("orderSn")String orderSn);

    //查询绣字高度-根据类别
    List<EmbroideredTypePriceInfo> query_xiuziHeightInfo(@Param("category_id")String category_id,@Param("xiuzi_type")String xiuzi_type);

    //根据品类id查询系统加急项--查询上级
    List<PriceTopSystemInfo> query_system_ToppriceInfo(@Param("category_id")String category_id);
    //根据品类id查询系统加急项
    List<AddSystemPriceInfo> query_system_priceInfo(@Param("category_id")String category_id, @Param("type")String type);
    //根据品类id和业务类型id查询价格体系记录
    MlccPriceSystemPinglei2 query_pricepinglei(@Param("category_id")String category_id,@Param("type")String type,@Param("is_gongyi")String is_gongyi);
    //根据品类id，价格体系id，参数id查询具体的成本记录
    MlccPriceSystemCostRecord query_pricepinglei_CostRecord(@Param("category_id")String category_id,@Param("price_id")String price_id,@Param("canshu_id")String canshu_id);

    //根据用户id查询团订订单列表
    IPage<TeamOrderInfo> query_teamOrderInfo(@Param("page")Page<TeamOrderInfo> page,@Param("user_id")String user_id,@Param("queryTime")String queryTime,@Param("queryName")String queryName);
    //根据用户id查询个订订单列表
    IPage<SingleOrderInfo> query_singleOrderInfo(@Param("page")Page<SingleOrderInfo> page,@Param("user_id")String user_id,@Param("queryTime")String queryTime,@Param("queryName")String queryName);

    //根据版号id查询辅料
    List<CategoryMaterialInfo> query_alllibuListBycategoryId(@Param("category_id")String category_id,@Param("type")String type);
    //根据版号id查询辅料--分页
    IPage<CategoryMaterialInfo> query_MaterialInfopageList(@Param("page")Page<CategoryMaterialInfo> page,@Param("category_id")String category_id,@Param("type")String type,@Param("code")String code,@Param("buttontype")String buttontype);
    //根据版号id查询绣字图片或者字体--分页
    IPage<EmbroideredFontInfo> query_xiuziImgpageList(@Param("page")Page<EmbroideredFontInfo> page,@Param("category_id")String category_id,@Param("type")String type,@Param("code")String code);
    //根据版号id查询绣字颜色--分页
    IPage<EmbroideredColorInfo> query_xiuziColorpageList(@Param("page")Page<EmbroideredColorInfo> page,@Param("category_id")String category_id,@Param("code")String code);

    //根据里布id查询里布/低领里详情
    CategoryMaterialInfo query_materialInfo(@Param("metarmail_id")String metarmail_id,@Param("type")int type);
    //查询协议详情
    AgreementInfo query_userXieyiDetail(@Param("msg_id")String msg_id,@Param("type")String type);
    //编辑产品--名称
    int update_only_productsName(@Param("id")String id,@Param("name")String name);
    //删除小产品
    int delete_small_product(@Param("id")String id);

    //根据客户id，大产品id，订单编号查询小产品详情
    SmallProductInfo query_smallproductInfoByType(@Param("customerId")String customerId,@Param("productId")String productId,@Param("orderSn")String orderSn);
    //根据尺寸id查询尺寸详情
    BodySizeInfo query_bodySizeInfoByid(@Param("bodysizeId")String bodysizeId);

    //根据产品id删除尺寸
    int delete_product_bodysize(@Param("product_id")String product_id);
    //根据里布id和版号地查询：type:1里布，2底领尼，3纽扣
    CategoryMaterialInfo query_materialDetail(@Param("metarmail_id")String metarmail_id,@Param("plate_id")String plate_id,@Param("type")int type);

    //根据品类id查询所有撞色
    List<ContrastcolorInfo> query_AllContrastInfoByCategoryId(@Param("category_id")String category_id);
    //根据撞色id查询撞色详情
    ContrastcolorInfo queryContrasDetail(@Param("category_id")String category_id,@Param("id")String id);
    //根据类别id查询身体数据
    List<BodySizeInfo> query_bodySizeinfoByplateId(@Param("category_id")String category_id);

    //根据版号id查询下面所有的定制项参数
    List<CategoryInfo> query_categorylistByplateId(@Param("plateId")String plateId);

    //根据客户id查询客户详情信息
    CustomerInfo query_customerDetailByid(@Param("customerId")String customerId,@Param("type")int type);
    //根据客户id查询客户下的所有部门
    List<CustomerDepartInfo> query_cusdepartList(@Param("customerId")String customerId);
    //根据客户id查询客户下的所有客户
    List<CustomerInfo> query_customerlistByparentId(@Param("customerId")String customerId);
    //根据部门id查询部门下的所有产品
    List<ProductInfo> query_productBydepartId(@Param("departId")String departId);
    //根据部门id/编码查询部门详情信息
    CustomerDepartInfo query_CustomerDepartDetailByid(@Param("departId")String departId,@Param("type")int type);
    //创建客户
    int add_newcustomer(CustomerInfo testinfo);
    //创建客户下的部门
    int add_newcustomer_depart(CustomerDepartInfo testinfo);
    //增加部门下的产品
    int add_newdepart_product(@Param("product_id")String product_id,@Param("depart_id")String depart_id,@Param("remark")String remark);

    //根据用户的公司id查询退款表
    List<RefundMoneyInfo> query_RefundMoneyInfo(@Param("company_user_id")String company_user_id);

    //根据订单编号和类型修改订单状态
    int change_order_status(@Param("orderSn")String orderSn,@Param("type")int type,@Param("applymethod")int applymethod);
    //插入流水表
    int insert_into_water(BusinessWaterInfo object);
    //插入订单跟踪表
    int insert_into_ordertracking(@Param("id")String id,@Param("order_sn")String order_sn,@Param("order_type")String order_type,@Param("remark")String remark,@Param("thing")String thing,@Param("order_status")int order_status);
    //插入订单事件表
    int insert_into_orderevent(@Param("id")String id,@Param("event_name")String event_name,@Param("type")int type,@Param("order_sn")String order_sn,@Param("order_type")String order_type,@Param("remark")String remark);
    //根据面料订单编号查询面料详情
    FabricOrderInfo query_fabricOrderDetailBycode(@Param("order_sn")String order_sn);

    //新增微信订单记录
    int add_wxorderinfo(WxOrderStatus testinfo);
    //根据微信订单号查询
    WxOrderStatus query_WxOrderStatusDetailBysn(@Param("outTradeNo")String outTradeNo);
    //修改微信订单记录的状态
    int update_wxorder_status(@Param("id")String id,@Param("status")String status);

    //根据上级品类id和编号查询类别详情
    CategoryInfo query_categoryDetailBytop_id(@Param("top_id")String top_id,@Param("code")String code);

    //根据订单号更新订单里面的产品
    int update_single_order_products(@Param("products")String products,@Param("orderSn")String orderSn);
    //根据订单号更新订单里面的产品
    int update_single_template_products(@Param("products")String products,@Param("templateSn")String templateSn);

    //查询商品详情
    ThirdGoodsInfo query_goodsDetailByid(@Param("goodsId")String goodsId);
    //根据商品系列id查询商品下面的阶梯价
    List<ThirdGoodsLadderPrice> query_rungpricedatalist(@Param("series_id")String series_id);
    //根据商品id查询商品下面的规格
    List<ThirdGoodsSpecifications> query_Specificationsdatalist(@Param("goodsId")String goodsId);
    //根据商品id查询商品下面的参数
    List<ThirdGoodParameter> query_Parameterdatalist(@Param("goodsId")String goodsId);

    //插入现货购物车
    int add_cart_goods(ThirdCartInfo datainfo);
    //插入现货购物车-下的规格购买数量
    int add_cart_goods_buynum(ThirdCartInfo datainfo);
    //根据商品id查询购物车
    ThirdCartInfo query_cartinfoBygoodId(@Param("goods_id")String goods_id,@Param("user_id")String user_id);
    //根据商品id、规格id、尺码id查询购物车下的规格购买数量
    ThirdCartInfo query_cartinfobuyNum_BygoodId(@Param("goods_id")String goods_id,@Param("guige_id")String guige_id,@Param("size_id")String size_id,@Param("user_id")String user_id);
    //执行修改购买数量
    int update_cart_goods_buynum(@Param("id")String id,@Param("nownum")String nownum);
    //执行修改购物车商品数量
    int update_cart_goods(@Param("id")String id,@Param("nownum")String nownum,@Param("money")String money);
}
